package sdk.webview.fmc.com.fmcsdk.activity;

import android.os.Bundle;
import android.view.View;
import android.widget.EditText;

import sdk.webview.fmc.com.fmcsdk.R;
import sdk.webview.fmc.com.fmcsdk.base.BaseActivity;
import sdk.webview.fmc.com.fmcsdk.interfaces.FeedBackView;
import sdk.webview.fmc.com.fmcsdk.presenter.FeedBackPresenter;
import sdk.webview.fmc.com.fmcsdk.util.TitleBar;
import sdk.webview.fmc.com.fmcsdk.view.FrameStyleColorButton;

/**
 * 意见反馈
 */
public class FeedBackActivity extends BaseActivity<FeedBackView, FeedBackPresenter> implements FeedBackView {

    TitleBar titlebar;
    EditText text;
    FrameStyleColorButton submit;


    @Override
    protected int getLayoutId() {
        return R.layout.activity_feed_back;
    }

    @Override
    protected void init(Bundle savedInstanceState) {
        titlebar = (TitleBar) findViewById(R.id.titlebar);
        text = (EditText) findViewById(R.id.text);
         submit = (FrameStyleColorButton) findViewById(R.id.submit);
        titlebar.setTitle(this.getResources().getString(R.string.feed_back));
        submit.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                presenter.submit(getText(text));
            }
        });
    }

    @Override
    protected FeedBackPresenter createPresenter() {
        return new FeedBackPresenter();
    }


    @Override
    public void submitSuccess() {
        finish();
    }
}
